﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace _35_C_中base和this
{
    internal class Animal
    {
        private string name;
        private int age;
        private string[] list = new string[20];

        public Animal()
        {
            Console.WriteLine("Animal的无参构造方法");
        }
        public Animal(string name, int age)
        {
            this.name = name;
            this.age = age;
            Console.WriteLine("Animal有无参构造方法");
        }

        public string this[int index]
        {
            get { return list[index]; }
            set { list[index] = value; }
        }

        public virtual void Show()
        {
            Console.WriteLine($"{name}  {age}");
        }

        public void Run()
        {
            Skill.CanRun(this);
        }
    }
}
